//获取当前版本号,加在URL后
if(!Global_Version)var Global_Version = "v=" + Math.random();

function getVerString(URL)
{
	if(!URL) return "";
	if(URL.indexOf("?")==-1)
	{
		return "?" + Global_Version;
	}
	else if (URL.substr(URL.length-1,1) == "?")
	{
		return Global_Version;
	}
	else
	{
		return "&" + Global_Version;
	}
}

/* --- geometry and timing of the menu --- */
var MENU_POS1 = new Array();
	// item sizes for different levels of menu
	MENU_POS1['height'] = [22, 25, 25];
	MENU_POS1['width'] = [50, 150, 185];
	// menu block offset from the origin:
	//	for root level origin is upper left corner of the page
	//	for other levels origin is upper left corner of parent item
	MENU_POS1['block_top'] = [-3, 24, 2];
	MENU_POS1['block_left'] = [10, 2, -185];
	// offsets between items of the same level
	MENU_POS1['top'] = [0, 21, 21];
	MENU_POS1['left'] = [131, 0, 0];
	// time in milliseconds before menu is hidden after cursor has gone out
	// of any items
	MENU_POS1['hide_delay'] = [200, 200, 200];
	
/* --- dynamic menu styles ---
note: you can add as many style properties as you wish but be not all browsers
are able to render them correctly. The only relatively safe properties are
'color' and 'background'.
*/
var MENU_STYLES1 = new Array();
	// default item state when it is visible but doesn't have mouse over
	MENU_STYLES1['onmouseout'] = [
		'color', ['#ffffff', '#ffffff', '#ffffff'], 
		'background', ['#4A7DA4', '#4A7DA4', '#4A7DA4'],
		'fontWeight', ['normal', 'normal', 'normal'],
		'textDecoration', ['none', 'none', 'none'],
	];
	// state when item has mouse over it
	MENU_STYLES1['onmouseover'] = [
		'color', ['#ffffff', '#ffffff', '#ffffff'], 
		'background', ['#568CB4', '#568CB4', '#568CB4'],
		'fontWeight', ['normal', 'normal', 'normal'],
		'textDecoration', ['none', 'none', 'none'],
	];
	// state when mouse button has been pressed on the item
	MENU_STYLES1['onmousedown'] = [
		'color', ['#ffffff', '#ffffff', '#ffffff'], 
		'background', ['#0A246A', '#0A246A', '#0A246A'],
		'fontWeight', ['normal', 'normal', 'normal'],
		'textDecoration', ['none', 'none', 'none'],
	];
	
	
	
function openwin(url){
var splashWin = window.open(url,'tip','fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,Resizable=1');
splashWin.resizeTo(602,420);
splashWin.moveTo(70,55);
}

var menus = [];

// --- menu class ---
function menu (item_struct, pos, styles) {
	// browser check
	this.item_struct = item_struct;
	this.pos = pos;
	this.styles = styles;
	this.id = menus.length;
	this.items = [];
	this.children = [];
	
	this.add_item = menu_add_item;
	this.hide = menu_hide;
	
	this.onclick = menu_onclick;
	this.onmouseout = menu_onmouseout;
	this.onmouseover = menu_onmouseover;
	this.onmousedown = menu_onmousedown;
	
	var i;
	for (i = 0; i < this.item_struct.length; i++)
		new menu_item(i, this, this);
	for (i = 0; i < this.children.length; i++)
		this.children[i].visibility(true);
	menus[this.id] = this;
}
function menu_add_item (item) {
	var id = this.items.length;
	this.items[id] = item;
	return (id);
}
function menu_hide () {
	for (var i = 0; i < this.items.length; i++) {
		this.items[i].visibility(false);
		this.items[i].switch_style('onmouseout');
	}
}
function menu_onclick (id) {
	var item = this.items[id];
	return (item.fields[1] ? true : false);
}
function menu_onmouseout (id) {
	this.hide_timer = setTimeout('menus['+ this.id +'].hide();',
		this.pos['hide_delay'][this.active_item.depth]);
	if (this.active_item.id == id)
		this.active_item = null;
}
function menu_onmouseover (id) {
	this.active_item = this.items[id];
	clearTimeout(this.hide_timer);
	var curr_item, visib;
	for (var i = 0; i < this.items.length; i++) {
		curr_item = this.items[i];
		visib = (curr_item.arrpath.slice(0, curr_item.depth).join('_') ==
			this.active_item.arrpath.slice(0, curr_item.depth).join('_'));
		if (visib)
			curr_item.switch_style (
				curr_item == this.active_item ? 'onmouseover' : 'onmouseout');
		curr_item.visibility(visib);
	}
}
function menu_onmousedown (id) {
	this.items[id].switch_style('onmousedown');
}
// --- menu item Class ---
function menu_item (path, parent, container) {
	this.path = new String (path);
	this.parent = parent;
	this.container = container;
	this.arrpath = this.path.split('_');
	this.depth = this.arrpath.length - 1;
	// get pointer to item's data in the structure
	var struct_path = '', i;
	for (i = 0; i <= this.depth; i++)
		struct_path += '[' + (Number(this.arrpath[i]) + (i ? 2 : 0)) + ']';
	eval('this.fields = this.container.item_struct' + struct_path);
	if (!this.fields) return;
	
	// assign methods	
	this.get_x = mitem_get_x;
	this.get_y = mitem_get_y;
	// these methods may be different for different browsers (i.e. non DOM compatible)
	this.init = mitem_init;
	this.visibility = mitem_visibility;
	this.switch_style = mitem_switch_style;
	
	// register in the collections
	this.id = this.container.add_item(this);
	parent.children[parent.children.length] = this;
	
	// init recursively
	this.init();
	this.children = [];
	var child_count = this.fields.length - 2;
	for (i = 0; i < child_count; i++)
		new menu_item (this.path + '_' + i, this, this.container);
	this.switch_style('onmouseout');
}
function mitem_init() {
	document.write (
		'<div id="mi_' + this.container.id + '_'
			+ this.id +'" class="m0l' + this.depth 
			+'o" onclick=PopMeUp(' + this.fields[1] + ') style="position: absolute; top: '
			+ this.get_y() + 'px; left: '	+ this.get_x() + 'px; width: '
			+ this.container.pos['width'][this.depth] + 'px; height: '
			+ this.container.pos['height'][this.depth] + 'px; visibility: hidden;'
			+' background: black; color: white; z-index: ' + this.depth + ';" '
			+ 'onclick="return menus[' + this.container.id + '].onclick('
			+ this.id + ');" onmouseout="menus[' + this.container.id + '].onmouseout('
			+ this.id + ');" onmouseover="menus[' + this.container.id + '].onmouseover('
			+ this.id + ');" onmousedown="menus[' + this.container.id + '].onmousedown('
			+ this.id + ');"><div id="mi_' + this.container.id + '_'
			+ this.id +'_1" class="m'  + this.container.id + 'l' + this.depth + 'i"style="position: absolute; top:4px;left:7px;cursor: default;" >'
			+ this.fields[0] + "</div></div>\n"
		);
	this.element = document.getElementById('mi_' + this.container.id + '_' + this.id);
}
function mitem_visibility(make_visible) {
	if (make_visible != null) {
		if (this.visible == make_visible) return;
		this.visible = make_visible;
		if (make_visible)
			this.element.style.visibility = 'visible';
		else if (this.depth)
			this.element.style.visibility = 'hidden';
	}
	return (this.visible);
}
function mitem_get_x() {
	var value = 0;
	for (var i = 0; i <= this.depth; i++)
		value += this.container.pos['block_left'][i]
		+ this.arrpath[i] * this.container.pos['left'][i];
	return (value);
}
function mitem_get_y() {
	var value = 0;
	for (var i = 0; i <= this.depth; i++)
		value += this.container.pos['block_top'][i]
		+ this.arrpath[i] * this.container.pos['top'][i];
	return (value);
}
function mitem_switch_style(state) {
	if (this.state == state) return;
	this.state = state;
	var style = this.container.styles[state];
	for (var i = 0; i < style.length; i += 2)
		if (style[i] && style[i+1])
			eval('this.element.style.' + style[i] + "='" 
			+ style[i+1][this.depth] + "';");
}

function PopMeUp(a) {
	var sURL;
	var icenter;
	var idialogWidth;
	var idialogHeight;
	var bShowScrollBar;
	var CnTitle;
	var EnTitle;
	if(a>0){
			//如果是打开自动搜索页面
		if (((a==23)||(a==25)) && (GetJobChance.XMLDocument.selectSingleNode("//RecordSet/Record/JobAlertCount").text==0))
		{
			if (LANGUAGE=='CN')
			{
				var str='你还没有设置求职意向，是否设置？';
			}else
			{
				var str='You havn\'t setted job alert,do you set?';
			};
			
			if (!confirm(str))
				return;
			a=23;
		}	
	switch(a) {
//1~~9为<我的帐户信息> 11~~19为<我的简历中心> 21~~29为<我的工作机会> 30~~39为<我的求职文件夹>  41~~49为<我的培训> 51~~70为< 我的测评>
		case   1: sURL="JobSeeking/EditPassword.htm"; bShowScrollBar=0; idialogWidth='400px'; idialogHeight="220px;"; break;
		case   2: sURL="JobSeeking/EditEmail.htm"; bShowScrollBar=0; idialogWidth="400px"; idialogHeight="220px"; break;
		case   3: sURL="JobSeeking/EditReceiveInformationSetting.htm"; bShowScrollBar=0; idialogWidth='400px'; idialogHeight="220px"; break;
		case   4: sURL="JobSeeking/WebShowSet.htm"; bShowScrollBar=0; idialogWidth='400px'; idialogHeight="220px"; break;
		case  11: window.open("/JobSeeker/CN/registernew/default.htm?FinishResume=Yes","FinishOrModifyResume","resizable=yes,scrollbars=auto,menubar=no,directories=no,toolbar=no,location=no,status=1,center=yes,help=yes");return;/*sURL="/JobSeeker/CN/MyJobsDB/JobSeeking/EditResume.asp"; bShowScrollBar=0; idialogWidth="700px"; idialogHeight="510px"; break;*/
		case  12: sURL="/JobSeeker/CN/MyJobsDB/JobSeeking/ResumePreview.htm"; bShowScrollBar=0; idialogWidth="680px"; idialogHeight="560px"; break;
		case  13: sURL="JobSeeking/SendResume.htm"; bShowScrollBar=0; idialogWidth="540px"; idialogHeight="420px"; break;
		case  14: sURL="JobSeeking/SavePhoto.asp"; bShowScrollBar=0; idialogWidth="480px"; idialogHeight="260px"; break;
		case  15: sURL="/JobSeeker/CN/MyJobsDB/JobSeeking/CoverLetter.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="680px"; idialogHeight="520px"; break;
		case  16: sURL="/JobSeeker/EN/MyJobsDB/JobSeeking/CoverLetter.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="680px"; idialogHeight="520px"; break;
		case  17: window.open("/JobSeeker/EN/registernew/default.htm?FinishResume=Yes","FinishOrModifyResume","resizable=yes,scrollbars=auto,menubar=no,directories=no,toolbar=no,location=no,status=1,center=yes,help=yes");return;/*sURL="/JobSeeker/EN/MyJobsDB/JobSeeking/EditResume.asp"; bShowScrollBar=0; idialogWidth="700px"; idialogHeight="510px"; break;*/
		case  18: sURL="JobSeeking/ResumeRefreshAlertOption.htm"; bShowScrollBar=0; idialogWidth="400px"; idialogHeight="200px"; break;

		case  21: sURL="JobSeeking/MyJobsChance.htm"; idialogWidth="720px"; bShowScrollBar=0; idialogHeight="500px"; break;
		case  22: sURL="JobSeeking/MyJobsFrame.htm?searchType=22"; idialogWidth="720px"; bShowScrollBar=0; idialogHeight="500px"; break;
		case  23: sURL="JobSeeking/MyJobsFrame.htm?searchType=23"; bShowScrollBar=0;idialogWidth="720px"; idialogHeight="500px"; break;
		case  24: sURL="JobSeeking/ResumeAuthorizing.htm"; bShowScrollBar=0; idialogWidth="680px"; idialogHeight="400px"; break;
		case  25: sURL="JobSeeking/EditJobAlertSetting.htm"; bShowScrollBar=1; idialogWidth="420px"; idialogHeight="190px"; break;
		case  31: sURL="JobSeeking/MyJobsFrame.htm?searchType=31"; bShowScrollBar=0;idialogWidth="720px"; idialogHeight="500px"; break;
		case  32: sURL="JobSeeking/MyJobsFrame.htm?searchType=32"; bShowScrollBar=0;idialogWidth="720px"; idialogHeight="500px"; break;
		case  33: sURL="JobSeeking/MyJobsFrame.htm?searchType=33"; bShowScrollBar=0;idialogWidth="720px"; idialogHeight="500px"; break;

		case  41: sURL="Training/tr_search.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="500px"; idialogHeight="340px"; break;
		case  42: sURL="Training/tr_minfo.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="500px"; idialogHeight="350px"; break;
		case  43: sURL="Training/receivetraininvite.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="680px"; idialogHeight="400px"; break;
		case  44: sURL="Training/mytrainfav.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="680px"; idialogHeight="400px"; break;
		case  45: sURL="Training/applytrainlesson.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="720px"; idialogHeight="400px"; break;
		case  46: sURL="Training/tr_minfo.htm"; bShowScrollBar=0; resizable=1; help=0; status=0; idialogWidth="500px"; idialogHeight="350px"; break;
		case  47: sURL="Training/mytrainrequire.htm"; bShowScrollBar=0; idialogWidth="640px"; idialogHeight="400px"; break;

		case  51: sURL="Testing/applyjob.htm"; bShowScrollBar=1; idialogWidth="740px"; idialogHeight="550px"; break;
		case  52: sURL="Testing/consult.htm"; bShowScrollBar=0; idialogWidth="400px"; idialogHeight="300px"; break;
		case  53: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=disc"; bShowScrollBar=0; idialogWidth='620px'; idialogHeight="470px"; break;
		case  54: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=zyxq"; bShowScrollBar=1; idialogWidth="620px"; idialogHeight="470px"; break;
		case  55: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=shtxwj"; bShowScrollBar=0; idialogWidth="620px"; idialogHeight="470px"; break;
		case  56: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=cxtlnlcy"; bShowScrollBar=0; idialogWidth='620px'; idialogHeight="470px"; break;
        case  57: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=glryljtlcy"; bShowScrollBar=0; idialogWidth='620px'; idialogHeight="470px"; break;
		case  58: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=mgxhgtclcy"; bShowScrollBar=0; idialogWidth='620px'; idialogHeight="470px"; break;
		case  59: sURL="/JobSeeker/CN/MyJobsDB/Testing/Exam.asp?testingtype=16pf"; bShowScrollBar=0; idialogWidth='620px'; idialogHeight="470px"; break;
		
		case  60: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=disc"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;
		case  61: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=zyxq"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;
		case  62: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=shtxwj"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;
		case  63: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=cxtlnlcy"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;
		case  64: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=glryljtlcy"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;
		case  65: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=mgxhgtclcy"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;
		case  66: sURL="/JobSeeker/CN/MyJobsDB/Testing/ExamResult.asp?testingtype=16pf"; idialogWidth="520px"; bShowScrollBar=0; idialogHeight="400px"; break;

		case  70: sURL="Testing/AddToResume.htm"; idialogWidth="450px"; bShowScrollBar=0; idialogHeight="350px"; break;																

		case  80: sURL="/JobSeeker/CN/MyJobsDB/Testing/questionnaire.htm"; idialogWidth="640px"; bShowScrollBar=0; idialogHeight="487px"; break;
		
        case  91: sURL="Testing/oldconsult.htm"; idialogWidth="640px"; bShowScrollBar=0; idialogHeight="480px"; break;
	}

		if (document.all) {

	var V6Sorting;
			
if (sURL == "JobSeeking/EditEmail.htm"){
	openURL = sURL + getVerString(sURL);
	OpenIFrameDialog(openURL,(new Array(xmlData.recordset('EmailAddress'))),'Resizable=1;ScrollBars=0;MenuBar=No;Directories=No;ToolBar=No;Location=No;Status=0;dialogWidth:'+idialogWidth+';dialogHeight:'+idialogHeight+';center:yes;help:no',CnTitle,EnTitle);
}else 
if (a>40)
{
	openURL = sURL + getVerString(sURL);
	showModalDialog(openURL,'V6JSHome'+PopMeUp.arguments[0],'Resizable=1;ScrollBars=0;MenuBar=No;Directories=No;ToolBar=No;Location=No;Status=0;dialogWidth:'+idialogWidth+';dialogHeight:'+idialogHeight+';center:yes;help:no');
}else
{
	var strLanguage='';
	if (PopMeUp.arguments.length>1)
		strLanguage=PopMeUp.arguments[1];
	openURL = sURL + getVerString(sURL);
	OpenIFrameDialog(openURL,'V6JSHome'+PopMeUp.arguments[0]+strLanguage,'Resizable=1;ScrollBars=0;MenuBar=No;Directories=No;ToolBar=No;Location=No;Status=0;dialogWidth:'+idialogWidth+';dialogHeight:'+idialogHeight+';center:yes;help:no',CnTitle,EnTitle);
}
if (sURL == "JobSeeking/WebShowSet.htm"){
	get_pagesize();
}
if (sURL == "JobSeeking/EditEmail.htm" || sURL == "JobSeeking/EditReceiveInformationSetting.htm"){
	MyBaseInfo()
	}

if ((sURL == "Training/applytrainlesson.htm") || (sURL == "Training/mytrainfav.htm") || (sURL == "Training/tr_minfo.htm") || (sURL == "Training/mytrainrequire.htm") || (sURL == "Training/tr_search.htm") ){
	Trrequest();
	}

if (sURL == "Testing/AddToResume.htm" || sURL=="/JobSeeker/CN/MyJobsDB/Testing/questionnaire.htm" || sURL == "Testing/oldconsult.htm") {
	Get_TestAttach();
	}

if (sURL.indexOf("Testing/Exam.asp")!=-1){   
   Get_TestingStatus();
}	
	
//工作速递设置
if (a==25){
	Get_JobChance();
}else						//我的求职意向
if ((a==21) || (a==22)||(a==23)){
	Get_AutoSearchCount();
	Get_JobChance();
	Get_JobFolder();		
}else						//查看面试通知/查看收藏夹/查看申请的工作/自动搜索结果/高级搜索/
if ((a==31) ||(a==32) ||(a==33)){
	Get_JobFolder();
}else						//我的简历中心
if ((a==11) || (a==14) || (a==15) || (a==16) || (a==17) || (a==18))
{
	if (LANGUAGE=='CN')
		Get_CNResumeStatus();
	else
		Get_ENResumeStatus();
}

	}	
  }
}

